package com.junyang.showdata.controller;

import com.junyang.showdata.common.CityCountDemo;
import com.junyang.showdata.pojo.CityData;
import com.junyang.showdata.service.CityService;
import com.junyang.showdata.utils.Result;
import com.junyang.showdata.utils.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author fusijia
 * @Date 2025/1/15 9:33
 * @notes 操作地市数据控制层
 */
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    private CityService cityService;

    /**
     *@notes 根据地区等级查询地区数量
     *@Author：fusijia
     *@Date：2025/1/15 9:42
     *@return：返回需要地市的数量
     */
    @PostMapping("/getCityCount")
    public Result<CityCountDemo> getCityCount() {
        CityCountDemo cityCountDemo = cityService.getCityCount();
        return new Result<>().success(cityCountDemo);
    }


}
